/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2014 All Rights Reserved.
 */
package com.lshtv.service;

import org.springframework.beans.factory.annotation.Autowired;

import com.lshtv.dao.ArticleDAO;
import com.lshtv.model.Article;

/**
 * 
 * @author danjingyu
 * @version $Id: ArticleServiceFacadeImpl.java, v 0.1 2014-3-11 下午11:22:10 danjingyu Exp $
 */
public class ArticleServiceFacadeImpl implements ArticleServiceFacade {
    @Autowired
    private ArticleDAO articleDAO;

    /** 
     * @see com.lshtv.service.ArticleServiceFacade#insertArticle(com.lshtv.model.Article)
     */
    public int addArticle(Article article) {
        articleDAO.save(article);
        return article.getId();
    }

    /** 
     * @see com.lshtv.service.ArticleServiceFacade#updateArticle(com.lshtv.model.Article)
     */
    public int updateArticle(Article article) {
        articleDAO.attachDirty(article);
        return article.getId();
    }

}
